<include file="Public:header"/>
<script type="text/javascript" src="__WEBPUBLIC__/Admin/js/ajax-operate.js"></script>
<!--主页面-->
<div id="main-content" class="content">
    <ul class="breadcrumb">
        <li><a href="{:U('Index/main')}">首页</a></li>
        <li class="active"><a href="">图文管理</a></li>
    </ul>

    <div class="page-header page-header1 clearfix">
        <h3>图文管理</h3>
        <ul class="nav nav-tabs">
            <li class="">
                <a href="{:U('WeiXinWeiXinArticle/wechatList')}">图文列表</a>
            </li>
        </ul>
    </div>

    <!--表格内容-->
    <div class="content-box-content">
        <!--表单 start-->
        <form action="{:U('WeiXinArticle/editWechat')}" method="post" class="form-horizontal" enctype="multipart/form-data">
            <input type="hidden" name="w_id" value="{$res['w_id']}">
            <div class="form-group" id="">
                <label for="title" class="col-sm-3 control-label"><em class="prompt-red">*</em>标题：</label>
                <div class="col-sm-9">
                    <input type="text" class="form-control" id="title" name="title"  placeholder="标题" value="{$res['title']}">
                </div>
            </div>
            <div class="form-group" id="">
                <label for="title" class="col-sm-3 control-label"><em class="prompt-red">*</em>关键词：</label>
                <div class="col-sm-9">
                    <input type="text" class="form-control" id="keywords" name="keywords"  placeholder="关键词" value="{$res['keywords']}">
                </div>
            </div>
            <div class="form-group" id="">
                <label for="title" class="col-sm-3 control-label"><em class="prompt-red">*</em>描述：</label>
                <div class="col-sm-9">
                    <textarea name="desc" id="" cols="80" rows="5">{$res['desc']}</textarea>
                </div>
            </div>
            <div class="form-group" id="">
                <label for="url" class="col-sm-3 control-label"><em class="prompt-red">*</em>链接地址：</label>
                <div class="col-sm-9">
                    <input type="text" class="form-control" id="url" name="url"  placeholder="链接地址" value="{$res['url']}">
                </div>
            </div>
            <div class="form-group" id="">
                <label for="url" class="col-sm-3 control-label"><em class="prompt-red">*</em>回复的类型：</label>
                <div class="col-sm-9">
                    <input type="text" class="form-control" id="type" name="type"  placeholder="回复的类型" value="{$res['type']}">
                    <span style="color: red">(1)加盟商登录回复</span>
                </div>
            </div>
            <div class="form-group" id="">
                <script>
                    function PreviewImage1(imgFile)
                    {
                        var filextension=imgFile.value.substring(imgFile.value.lastIndexOf("."),imgFile.value.length);
                        filextension=filextension.toLowerCase();
                        if ((filextension!='.jpg')&&(filextension!='.gif')&&(filextension!='.jpeg')&&(filextension!='.png')&&(filextension!='.bmp'))
                        {
                            alert("对不起，系统仅支持标准格式的照片，请您调整格式后重新上传，谢谢 !");
                            imgFile.focus();
                        }
                        else
                        {
                            var path;
                            if(document.all)//IE
                            {
                                imgFile.select();
                                path = document.selection.createRange().text;
                                document.getElementById("imgPreview1").innerHTML="";
                                document.getElementById("imgPreview1").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',sizingMethod='scale',src=\"" + path + "\")";//使用滤镜效果
                            }
                            else//FF
                            {
                                path=window.URL.createObjectURL(imgFile.files[0]);// FF 7.0以上
                                //path = imgFile.files[0].getAsDataURL();// FF 3.0
                                document.getElementById("imgPreview1").innerHTML = "<img id='img1'src='"+path+"' style='width:100px;height:100px'/>";
                                //document.getElementById("img1").src = path;
                            }
                        }
                    }
                </script>
                <label for="title" class="col-sm-3 control-label"><em class="prompt-red">*</em>图文封面：</label>
                <div class="col-sm-9">
                    <input type="file" name="pic" id="" onchange="PreviewImage1(this)"/>
                    <div id="imgPreview1">
                        <img src="/Uploads/{$res['pic']}" alt="" width="150px;" height="auto">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-3 col-sm-9">
                    <input type="submit" class="btn btn-default btn-primary" value="确认修改">
                </div>
            </div>
        </form>
        <!--表单 end-->
    </div>
</div>
</div>
<include file="Public:footer"/>
